﻿namespace Wallpaper.Models.Entities
{

    /// <summary>
    /// 用户浏览表
    /// </summary>
    public class ViewRecord
    {

        public string Id { get; set; }
        /// <summary>
        /// 用户ID（可为空，支持未登录用户浏览）
        /// </summary>
        public string? UserId { get; set; }

        /// <summary>
        /// 壁纸ID
        /// </summary>
        public string WallpaperId { get; set; }

        /// <summary>
        /// 浏览时间
        /// </summary>
        public DateTime ViewedAt { get; set; }

        /// <summary>
        /// 停留时长（秒）
        /// </summary>
        public int? Duration { get; set; }

        /// <summary>
        /// 用户IP
        /// </summary>
        public string? IPAddress { get; set; }

        // 导航属性
        public virtual Wallpapers Wallpaper { get; set; }

        public virtual User? User { get; set; }
    }
}
